Repository navigation
Conversation
When the dnsmasq instance has no server entries, the first start stores a single empty doh_backup_server element. A second start without a stop in between (restart, reload, a config change from LuCI) gets an empty string from uci_get and treats that as no backup. It then copies the current server list, the canary entries and the proxy listeners, into doh_backup_server. The next stop restores them into the dnsmasq server list, so dnsmasq keeps forwarding to the stopped listeners and keeps answering the canary domains locally. Test whether doh_backup_server exists, as the restore side already does, so an empty backup stays empty. Add a test that creates the backup twice without a restore and checks that the restore leaves no server entries. Signed-off-by: Semih Baskan <strst.gs@gmail.com>
The start adds the canary entries to the dnsmasq server list, but unlike the proxy listeners it does not record them in doh_server. The stop removes them only for the canary options that are on at that moment. When canary_domains_icloud or canary_domains_mozilla is turned off while the service runs, the next stop leaves those entries in place and dnsmasq keeps answering the canary domains locally. Record the canary entries in doh_server as well, like the listeners, so the stop removes everything the start added. The loop over the enabled canary domains on the remove side stays, for entries that older versions added. Add a test that turns the canary domains off between start and stop, with the user's own canary entry in the original server list, and checks that the stop leaves only that entry. Signed-off-by: Semih Baskan <strst.gs@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two cases where a stop leaves entries in the dnsmasq server list, one commit each.
With the service stopped and the default dhcp and https-dns-proxy configs:
service https-dns-proxy start:doh_backup_server=''service https-dns-proxy restart:doh_backup_server='' '/mask.icloud.com/' '/mask-h2.icloud.com/' '/use-application-dns.net/' '127.0.0.1#5053' '127.0.0.1#5054'service https-dns-proxy stop:server='/mask.icloud.com/' '/mask-h2.icloud.com/' '/use-application-dns.net/' '127.0.0.1#5053' '127.0.0.1#5054'stays in the dnsmasq sectionuci_get prints nothing for the single empty doh_backup_server element, so the second start takes it for a missing backup and saves the proxy's own entries. The first commit tests whether the option exists, as the restore side already does.
From the same starting state:
service https-dns-proxy startuci set https-dns-proxy.config.canary_domains_icloud='0',uci set https-dns-proxy.config.canary_domains_mozilla='0',uci commit https-dns-proxyservice https-dns-proxy stop:server='/mask.icloud.com/' '/mask-h2.icloud.com/' '/use-application-dns.net/'stays in the dnsmasq sectionThe stop removes the canary entries only for the options that are on at that moment. The second commit records them in doh_server like the listeners, so the stop removes them either way.
A settings change that only reloads the service, such as saving in LuCI, still leaves the canary entries in place until the next stop. Entries that earlier stops already left in the server list stay there and have to be removed once by hand.
Tested: tests/run_tests.sh passes, and each new case fails without its commit. The same steps through start_service and stop_service, with the uci and /lib/functions.sh of OpenWrt snapshot r37187, give the output above without the commits and leave no server entries with them. The first case was also seen on a router running 2026.05.06-r1, after a restart.
Same symptoms as openwrt/packages#23469 (issue 2), openwrt/packages#26169 and #2.